﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace UI
{
    public partial class Form1 : Form
    {

        private BL.Server server;
        private Thread thread;
        private int port = 11000;

        public Form1()
        {
            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            server = new BL.Server(port);
            thread = new Thread(new ThreadStart(server.StartListening));
            thread.Start();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            server.StopListening();
            thread.Join();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            
        }

    
    }
}
